<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="costReport_Form_div">
    <form id="costReport_Form" method="post">

        <!-- 开始表单 -->
        <div style="margin-left:10px;text-align: left">
            <div style="margin: 0px 0px 10px 0px">
                <input id="costReportId" class="easyui-textbox"
                       data-options="required:true,editable:false,label:'成本单据',labelWidth:'60',width:230"
                       name="costReportId">
                <span id="finishedProductCodeTooltip">
                    <input id="finishedProductCodeZt_0" name="finishedProductCode" style="display: none">
                    <span id="finishedProductCodeZtSpan" >
                    <input id="finishedProductCodeZt"  class="easyui-textbox"  data-options="label:'成品编码',labelWidth:'60',readonly:'true',prompt:'请先选择公司账套',width:230" >
                    </span>
                    <span id="finishedProductCodeZtSpan1" style="display: none">
                        <input   id="finishedProductCodeZt_1" class="easyui-textbox"  data-options="label:'成品编码',labelWidth:'60',width:160" >~
                        <input   id="finishedProductCodeZt_2" class="easyui-textbox"  data-options="width:60" >
                    </span>
                </span>

                <input class="easyui-numberbox"
                       data-options="label:'订单量',labelWidth:'60',width:230,onChange:orderQuantityIdOnChange"
                       name="orderQuantity" id="orderQuantityId">
                <input id="costReportDate" class="easyui-datebox" editable="false" name="costReportDate"
                       data-options="label:'日期',current:true,labelWidth:'60',width:230">
                <input id="costEdition" class="easyui-numberbox"
                       data-options="labelAlign:'left',label:'版本',labelWidth:'60',width:150"
                       name="costEdition">
            </div>
            <div style="margin: 0px 0px 10px 0px">
                <input id="costReport_Form_salesPkOrg"
                       data-options="required:true,label:'销售组织',labelWidth:'60',valueField:'pkOrg',width:230,textField:'name'"
                       name="salesPkOrg">
                <input class="easyui-textbox" id="productName" name="productName"
                       data-options="label:'产品名称',width:230,labelWidth:'60'">
                <input id="costReport_Form_capacity" class="easyui-textbox" name="capacity"
                       data-options="label:'容量规格',width:230,labelWidth:'60'">
                <input id="costReport_Form_costReportUnits" class="easyui-textbox" name="costReportUnits"
                       data-options="label:'单位',width:230,labelWidth:'60'">
            </div>
            <div style="margin: 0px 0px 10px 0px">
                <span id="costReport_Form_pkOrgAccountTooltip">
                <input id="costReport_Form_pkOrgAccount"
                       data-options="required:true,readonly:'true',label:'公司账套',prompt:'需先选择销售组织',labelWidth:'60',width:230,valueField:'pkOrg',textField:'name'"
                       name="pkOrgAccount">
                </span>
                <input class="easyui-textbox" id="clientcode" name="clientcode" data-options="label:'客户编码',labelWidth:'60',width:230">
                <input class="easyui-textbox" id="clientName" name="clientName" data-options="label:'客户全称',labelWidth:'60',width:230">
                <input class="easyui-textbox" name="quotation" data-options="label:'报价单编号',labelWidth:'70',width:230">
            </div>
            <div>
                <span id="costReport_Form_departmentTooltip">
                <input id="costReport_Form_department" name="department" class="easyui-combotree"
                       data-options="required:true,panelWidth:200,readonly:'true',label:'部门',labelWidth:'60',width:230,prompt:'需先选择公司账套'"/>
                </span>
                <input class="easyui-combobox" data-options="required:true,valueField: 'value',label:'更新类型',labelWidth:'60',width:230,panelHeight:100,
                textField: 'label',data: [{ label: '新报价',value: '1'},{label: '更新成本',value: '2'},{label: '更新报价',value: '3'}]" name="updateType">
                <input class="easyui-combobox" data-options="required:true,valueField: 'value',label:'此成品是否含客料',labelWidth:'120',width:230,panelHeight:80,
                textField: 'label',data: [{label: '是',value: '1'},{label: '否',value: '2'}]" name="finishedProduct">
                <input class="easyui-combobox" data-options="required:true,valueField: 'value',label:'此配方是否含客料',labelWidth:'120',width:230,panelHeight:80,
                textField: 'label',data: [{label: '是',value: '1'},{label: '否',value: '2'}]" name="whetherSupplier">
                <input class="easyui-combobox" data-options="required:true,valueField: 'value',label:'销售类型',labelWidth:'60',width:150,panelHeight:80,
                textField: 'label',data: [{label: '内销',value: '内销'},{label: '外销',value: '外销'}]" name="saleType">
            </div>
        </div>
        <!-- A 水料价 -->
        <div style="width: 98%;margin: 20px;margin-left: 10px;border:2px #FFFF00 solid">
            <table fitColumns="true" iconCls="icon-edit" id="cost_report_a" idField="id" showFooter="true"
                   singleSelect="true" style="width:100%;height:auto;"  title="<span style='color: #7c5aae;background-color: #FFFF00'>A 水料价:</span><span style='color: green'>报价率为成本【￥5/kg以下X2】【￥5/kg-￥10/kgX1.75】【￥10/kg-￥20/kgX1.5】如少有/全新的配方或开料复杂要先咨询开发部才定</span>
" toolbar="#cost_report_a_tb">
                <thead>
                <tr>
                    <th align="center" field="id" hidden="true" width="80">id</th>
                    <th align="center"
                        editor="{type:'numberbox',options:{precision:4,required:true,onChange: function () {setEditing_actual_value(this)}}}"
                        field="labelCapacity"
                        width="120">
                        标签容量(1\kg)
                    </th>
                    <th align="center"
                        editor="{type:'numberbox',options:{precision:4,required:true,onChange: function () {setEditing_actual_value(this)}}}"
                        field="ratio"
                        width="80">
                        比重率
                    </th>
                    <th align="center"
                        editor="{type:'numberbox',options:{precision:6,required:true,prompt:'系统自动计算'}}"
                        field="actualValue"
                        width="120">
                        实际灌装重量(kg)
                    </th>
                    <th align="center"
                        editor="{type:'textbox',options:{prompt:'手工输入'}}"
                        field="unitName" width="150">水料名称
                    </th>
                    <th align="center"
                        editor="{type:'textbox',options:{onChange:detailNameOnChange,readonly:'true',prompt:'请先算出重量才能输入'}}"
                        field="detailName" width="150">配方号
                    </th>
                    <th align="center"
                        editor="{type:'numberbox',options:{precision:4,required:true,prompt:'系统获取/手输入',onChange:setEditing_cost_price}}"
                        field="unitPrice"
                        width="120">
                        水料单价(kg)
                    </th>
                    <th align="center"
                        editor="{type:'numberbox',options:{precision:4,required:true,readonly:'true',prompt:'系统自动计算'}}"
                        field="costPrice"
                        width="120">
                        成本价/pcs
                    </th>
                    <th align="center"
                        editor="{type:'numberbox',options:{precision:2,required:true,prompt:'系统自动计算'}}"
                        field="quotedPrice"
                        width="120">
                        报价率(2至1.5)/pcs
                    </th>
                    <th align="center"
                        editor="{type:'numberbox',options:{precision:4,required:true,readonly:'true',prompt:'系统自动计算'}}"
                        field="benchmarkPrice" width="120">
                        报价基准
                    </th>
                </tr>
                </thead>
            </table>
            <div id="cost_report_a_tb" style="text-align: right">
                <a class="easyui-linkbutton" href="#" iconCls="icon-add"
                   onclick="javascript:$('#cost_report_a').edatagrid('addRow')"
                   plain="true">添加</a>
                <a class="easyui-linkbutton" href="#" iconCls="icon-remove"
                   onclick="javascript:$('#cost_report_a').edatagrid('destroyRow')"
                   plain="true">删除</a>
                <a class="easyui-linkbutton" href="#" iconCls="icon-save"
                   onclick="javascript:$('#cost_report_a').edatagrid('saveRow')"
                   plain="true">保存</a>
            </div>
        </div>

        <!-- B 人工 -->
        <div style="width: 98%;margin: 20px;margin-left: 10px;border: #00F7DE solid 2px">
            <table fitColumns="true" iconCls="icon-edit" id="cost_report_b" idField="id" showFooter="true"
                   style="width:100%;height:auto" title="<span style='color: #0000FF;background-color:#00F7DE'>B 人工: </span><span style='color: green'>人工——成本工时单价为￥20/小时，（工时计算按澳宝惠州/兆婷提供的工时计算表）</span>
                    " toolbar="#cost_report_b_tb">
                <thead>
                <tr>
                    <th align="center" field="id" hidden="true" width="100">id</th>
                    <th align="center" field="costId" hidden="true" width="100">计算单支工时操作详情关联字段</th>
                    <th align="center" field="subId" hidden="true" width="100">产品标准工时id</th>
                    <th align="center" field="workerType" data-options='formatter:changeWorkerTypeNname' ,
                        editor="{type:'textbox',options:{required:true,readonly:'true'}}" width="30">工作类型
                    </th>
                    <th align="center"
                        editor="{type:'numberbox',options:{precision:4,required:true,readonly:'true',prompt:'系统自动计算'}}"
                        field="pieceTime" width="20">单支工时
                    </th>
                    <th align="center"
                        editor="{type:'numberbox',options:{required:true,readonly:'true',prompt:'系统自动计算'}}"
                        field="standardTime" width="20">标准工时
                    </th>
                    <th align="center"
                        editor="{type:'numberbox',options:{required:true,readonly:'true',prompt:'系统自动计算'}}"
                        field="timeUnitPrice" width="20">工时单价
                    </th>
                    <th align="center"
                        editor="{type:'numberbox',options:{precision:4,required:true,readonly:'true',prompt:'系统自动计算'}}"
                        field="price" width="20">价格/pcs
                    </th>
                    <th align="center" editor="{type:'textbox',options:{}}" field="processDecomposition" width="100">
                        工艺分解/pcs
                    </th>
                </tr>
                </thead>
            </table>


            <div class="easyui-panel"
                 title="<span style='color: #987dbf'>其它费用: </span><span style='color: green'>实报实销</span>"
                 style="width:100%;height:90px;padding:10px;background:#fafafa;"
                 data-options="collapsible:true">

                <label style="margin-left: 20px"><a id="calculateFumigationCharge" href="javascript:void(0)" pageHtml="fumigationChargeCost.html">熏蒸费</a></label>
                <input class="easyui-numberbox" data-options="required:true,precision:4" id="fumigation_charge"
                       name="fumigationCharge"  style="width: 60px"
                       value="0.000">

                <label style="margin-left: 20px"><a id="calculateCartonCertificate" href="javascript:void(0)" pageHtml="cartonCertificateCost.html">纸箱证明书</a></label>
                <input class="easyui-numberbox" data-options="required:true,precision:4" id="carton_certificate"
                       name="cartonCertificate" style="width: 60px" value="0">

                <label style="margin-left: 20px"><a id="calculateFreight" pageHtml="freightFormulaCost.html" href="javascript:void(0)" >运费</a></label>
                <input class="easyui-numberbox" data-options="required:true,precision:4" id="freight" name="freight"
                   style="width: 60px"
                   value="0.000">

                <label style="margin-left: 20px"><a id="calculateCustoms_fee" href="javascript:void(0)" pageHtml="customsFeeCost.html">出口报关费用\检查费用</a></label>
                <input class="easyui-numberbox" data-options="required:true,precision:4" id="customs_fee"
                       name="customsFee"
                       style="width: 60px"
                       value="0.000">

                <label style="margin-left: 20px"><a id="calculateOtherChargesZt" onclick="calculateOtherChargesZtOnClick()" href="javascript:void(0)" pageHtml="calculateOtherChargesCost.html">授权费\顾问\其他</a></label>
                <input class="easyui-numberbox" data-options="required:true,precision:4" id="other_charges"
                       name="otherCharges" style="width: 60px"
                       value="0.000">
                <label style="margin-left: 13%">其他费用合共</label>
                <input class="easyui-numberbox" data-options="required:true,precision:4,readonly:'true'"
                       id="other_charges_total"
                       name="otherChargesTotal"
                       style="width: 60px" value="0">
            </div>
            <div style="margin: 10px;">
                <label>Total of Part B:</label>
                <input class="easyui-numberbox" data-options="required:true,precision:4,readonly:'true'"
                       id="totalOfPartB"
                       name="totalOfPartB"
                       style="width: 70px" value="0">

                <input id="totalOfPartA" name="totalOfPartA" style="display:none" type="text">

                <input id="quotedPriceBenchmarkA" name="quotedPriceBenchmarkA" style="display:none" type="text">

                <input id="manHourTotal" name="manHourTotal" style="display:none" type="text">

                <input id="laborCostTotal" name="laborCostTotal" style="display:none" type="text">

                <input id="totalOfPartC" name="totalOfPartC" style="display:none" type="text">
            </div>
        </div>

        <!-- B 人工 工具栏 -->
        <div id="cost_report_b_tb" style="text-align: right;">
            <a class="easyui-linkbutton" href="#" iconCls="icon-add"
               onclick="formatCountItem()"
               plain="true">标准工时详情</a>
            <a class="easyui-linkbutton" href="#" iconCls="icon-add"
               onclick="formatCount()"
               plain="true">添加</a>
            <a class="easyui-linkbutton" href="#" iconCls="icon-remove"
               onclick="javascript:$('#cost_report_b').edatagrid('destroyRow')"
               plain="true">删除</a>
            <a class="easyui-linkbutton" href="#" iconCls="icon-save"
               onclick="javascript:$('#cost_report_b').edatagrid('saveRow')"
               plain="true">保存</a>
        </div>
        <!--选择类型工时弹窗-->
        <div closed="true" id="InitialInfo_dlg" class="easyui-dialog">
            <div id="InitialInfo_table2_tb" style="padding:2px 5px;display: none">
                <div class="easyui-panel" style="width:100%;">
                    <input class="easyui-searchbox" data-options="prompt:'请输入内容',menu:'#InitialInfo_crii_mu',searcher:InitialInfo_doSearch" style="width:50%">
                    <input id="InitialInfo_crii_type" class="easyui-combobox" style="width:33%" value="配制人工" data-options="buttonText:'类型',buttonAlign:'left',data:[{'id':'1','text':'配制人工'},{'id':'2','text':'灌装基础人工'},{'id':'3','text':'灌装/组装人工'},{'id':'4','text':'搬运人工'}],
                        valueField:'id',textField:'text',onChange: setEditing_worker_type">
                    <input id="InitialInfo_crii_multiple" class="easyui-numberbox" style="width:16%" data-options="buttonText:'倍数',buttonAlign:'left'">
                </div>
                <div id="InitialInfo_crii_mu">
                    <div data-options="name:'typeName'">类型名称</div>
                    <div data-options="name:'num'">序号</div>
                </div>

            </div>
            <div class="easyui-layout" data-options="fit:true">

                <div data-options="region:'east'" style="width:445px;padding:10px">
                    <table id="InitialInfo_table" fitColumns="true" singleSelect="true"
                           style="width: 100%;height: auto">
                    </table>
                </div>
                <div data-options="region:'center'" style="padding:1px 15px 0px 1px">
                    <table id="InitialInfo_table2" fitColumns="true" singleSelect="true"
                           style="width: 100%;height: auto">
                    </table>
                </div>
            </div>

        </div>

        <!-- c 配件费 -->
        <div style="width: 98%;margin: 20px;margin-left: 10px;border: #eb7350 solid 2px ">
            <table iconCls="icon-edit" id="cost_report_c" idField="id" showFooter="true"
                   singleSelect="false" style="width:100%;height:auto"
                   title="<span style='color: #1f637b;background-color:#eb7350'>C 配件费: </span><span style='color: green'> 实报</span>"
                   toolbar="#cost_report_c_tb">
                <thead>
                    <tr>
                        <th align="center" field="id" hidden="true" width="100">id</th>
                        <th align="center" editor="{type:'textbox'}" field="coding" width="30">品号</th>
                        <th align="center" editor="{type:'textbox',options:{required:true}}" field="mountings" width="100">配件</th>
                        <th align="center" editor="{type:'numberbox',options:{precision:4,required:true}}"field="mountingsPrice" width="30">
                            配件价格</th>
                        <th align="center" editor="{type:'textbox'}" field="mountingsRemark" width="80">备注</th>
                    </tr>
                </thead>
            </table>
            <!-- 配件费工具栏 -->
            <div id="cost_report_c_tb" style="text-align: right;">
                <a class="easyui-linkbutton" href="#" iconCls="icon-remove" onclick="emptyMountings()"
                   plain="true">清空</a>
                <a class="easyui-linkbutton" href="#" iconCls="icon-remove" onclick="javascript:$('#cost_report_c').edatagrid('destroyRow')"
                   plain="true">删除</a>
                <a class="easyui-linkbutton" href="#" iconCls="icon-add" onclick="addTarton()"
                   plain="true">纸箱</a>
                <a class="easyui-linkbutton" href="#" iconCls="icon-add" onclick="systemMountings()"
                   plain="true">添加系统配件</a>
                <a class="easyui-linkbutton" href="#" iconCls="icon-add" onclick="javascript:$('#cost_report_c').edatagrid('addRow')"
                   plain="true">自定义添加</a>
                <a class="easyui-linkbutton" href="#" iconCls="icon-save" onclick="javascript:$('#cost_report_c').edatagrid('saveRow')"
                   plain="true">保存</a>
            </div>

        </div>
        <div style="width: 98%;margin: 20px 10px 5px 10px;background-color: #fff" >
            <label><span style="font-weight: bold;font-size: 22px">整体统计如下：</span></label>
            <hr>
            <table>
<!-- T2税项-->
            <tr>
                <td>
                    <label><span style="font-weight: bold;font-size: 16px">T2税项</span>[增值税/出口税]： 计算公式： [F-(A+C)] x 税率(內销
                    13%,外销 4%)</label>
                </td>
                <th style="text-align: right;width: 150px;">
                    <input class="easyui-numberbox" data-options="required:true" id="v_a_t_export_tax_rate"
                           name="vatexportTaxRate" style="width: 40px" value="4">%
                </th>
                <th style="text-align: right;width: 60px">Tax税款:</th>
                <th style="text-align: right">
                    <input class="easyui-numberbox" data-options="required:true,precision:4" id="v_a_t_export_tax_cost"
                           name="vatexportTaxCost" style="width:  60px" value="0">
                </th>
            </tr>
                <!--                T3税项-->
            <tr>
                <td>
                    <label><span style="font-weight: bold;font-size: 16px">T3税项</span>[城建、教育税]： 计算公式：T2 x 12% </label>
                </td>
                <th style="text-align: right">
                    <input class="easyui-numberbox" data-options="required:true" id="tax_item_rate" name="taxItemRate"
                           style="width: 40px" value="12">%
                </th>
                <th style="text-align: right;width: 60px">Tax税款:</th>
                <th style="text-align: right">
                    <input class="easyui-numberbox" data-options="required:true,precision:4" id="tax_item__cost"
                           name="taxItemCost" style="width: 60px" value="0">
                </th>
            </tr>
                <!--                D总成本-->
            <tr>
                <td><label><span style="font-weight: bold;font-size: 16px">D总成本</span>： 计算公式：A+B+C x（1.05~1.1）</label></td>
                <th style="text-align: right">
                    <label>配件耗损率</label>
                    <input class="easyui-numberbox" data-options="required:true,precision:2" id="accessories_loss_rate"
                           name="accessoriesLossRate" style="width: 40px" value="1.05">%
                </th>
                <th></th>
                <th style="text-align: right">
                    <input class="easyui-numberbox" data-options="required:true,precision:4" id="total_cost" name="totalCost" style="width: 60px" value="0">
                </th>
            </tr>
                <!--  DT总成本含税-->
            <tr>
                <td> <label><span style="font-weight: bold;font-size: 16px">DT总成本含税</span>： 计算公式：D+T2+T3</label></td>
                <th></th>
                <th></th>
                <th style="text-align: right">
                    <input class="easyui-numberbox" data-options="required:true,precision:4" id="total_cost_includes_tax"
                             name="totalCostIncludesTax" style="width: 60px" value="0">
                </th>
            </tr>
                <!--  E报价基准-->
            <tr>
                <td>
                    <label><span style="font-weight: bold;font-size: 16px">E报价基准</span>：
                        计算公式：A报价基准+B其他+B工时x单价(¥25-30)+C*(1.05~1.1)+两个Tax税款</label>
                </td>
                <th></th>
                <th></th>
                <th style="text-align: right">
                    <input class="easyui-numberbox" data-options="required:true,precision:4" id="quoted_price_benchmark"
                           name="quotedPriceBenchmark" style="width: 60px" value="0">
                </th>
                <th style="text-align: right;width: 120px">
                    <label style="margin-left: 18px">工时单价</label>
                    <input class="easyui-numberbox" data-options="required:true" id="quoted_price_man_hour"
                            name="quotedPriceManHour" style="width: 40px" value="20">
                </th>
            </tr>
                <!--  F实际报价-->
            <tr>
                <td><label><span style="font-weight: bold;font-size: 16px">F实际报价</span>:（手工输入）</label></td>
                <th></th>
                <th></th>
                <th style="text-align: right">
                    <input class="easyui-numberbox" data-options="required:true,precision:4"
                           id="reality_quoted_price"
                           name="realityQuotedPrice" style="width: 60px" value="0">
                </th>
                <th style="text-align: center">
                    <label style="margin-left: 20px">兑换率</label>
                    <input class="easyui-numberbox" data-options="precision:4,required:true" id="conversion_rate"
                           name="conversionRate" style="width: 60px" value="1">
                </th>
                <th style="text-align: center">
                    <label style="margin-left: 5px">货币</label>
                    <input class="easyui-combobox" data-options="required:true,missingMessage:'请先输入实际报价！'"
                           id="costCurrency_type" name="currencyType" readonly="true" value="RMB"
                           style="width: 60px">
                </th>
                <th style="text-align: center">
                    <label style="margin-left: 5px">兑后金额</label>
                    <input class="easyui-numberbox" data-options="precision:4,required:true" name="conversionMoney"
                           id="conversionMoney"
                           style="width: 60px">
                </th>
            </tr>

            </table>
            <hr>
            <div style="margin-top: 10px;padding-left: 630px">
                <div style="margin-bottom: 10px">
                    <label><span style="font-weight: bold;font-size: 16px;margin-left: 116px">整套毛利</span>[计算公式：F-DT]：</label>
                    <input class="easyui-numberbox" data-options="readonly:'true',required:true,precision:4" id="grossMarginMoney"
                           name="grossMarginMoney" style="width:  60px" value="0">￥
                </div>
                <div>
                    <label style="margin-left: 15px"><span style="font-weight: bold;font-size: 21px">整套毛利百分比</span>[计算公式：(F-DT)/F]：</label>
                    <input class="easyui-numberbox" data-options="readonly:'true',required:true,precision:2" id="grossMarginRate"
                           name="grossMarginRate" style="width: 60px" value="0">%
                </div>
                <!-- 外销单-->
                <div id="costExportales_div"></div>
            </div>

        </div>
    </form>
</div>
<script th:inline="none" type="text/javascript" src="/js/costReportForm/costReportCommon.js"></script>
<script th:inline="none" type="text/javascript" src="/js/costReportForm/costReportForm.js"></script>
<script th:inline="none" type="text/javascript" src="/js/costReportForm/costReportInit.js"></script>
<script th:inline="none" type="text/javascript" src="/js/costReportForm/costReportForm_zt.js"></script>
</body>
</html>